package longcaisuyun.longcai.com.yiliubabalongcaisuyun;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.List;

import longcaisuyun.longcai.com.suyunbean.FuWuBean;


/**
 * Created by Administrator on 2016/3/31.
 */
public class FuWuAdapter extends BaseAdapter {
    Context context;
    List<FuWuBean> list;
    ViewHolder viewHolder;

    public FuWuAdapter(Context context, List<FuWuBean> list) {
        this.context = context;
        this.list = list;
    }

    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = View.inflate(context, R.layout.item_fuwu, null);
            viewHolder = new ViewHolder();
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.relativeLayout = (RelativeLayout) convertView.findViewById(R.id.relativeLayout);
        viewHolder.textView = (TextView) convertView.findViewById(R.id.tv_title);
        viewHolder.textView.setText(list.get(position).getTitle());
        viewHolder.textView.setTextSize(30);
        MyApplication.ScaleScreenHelper.loadView((ViewGroup) convertView);
        return convertView;

    }

    class ViewHolder {
        public TextView textView;
        public RelativeLayout relativeLayout;
    }
}
